"""
@author: Sergiy Tsymbalyuk
"""

import logging

from repoze.what.plugins.pylonshq import ControllerProtector

from chowa.lib.site.crud import FlatCrudController
from chowa.model.organization import Division
from hrms.lib.predicates import profile
from hrms.model.organization import Dismissal

log = logging.getLogger(__name__)

@ControllerProtector(profile())
class DismissalsController(FlatCrudController):
    __model__ = Dismissal
    __columns__ = ['employee', 'position', 'division', 'division.district', 'executed']
    __edit_columns__ = ['employee', 'position', 'division', 'order', 'executed']
    __filters__ = {'division_id': (Division, 'district')}
    __order__ = ['executed']
